package com.luanqibazao;

public class TestFactorial {
    private static final int Max_num=4;
    public void main(String[] args){
    for(int i=0;i<Max_num;i++) {
        println(i+"! ="+factorial(i));
    }
    }
    private int factorial(int n){
        int result=1;
        for(int i=1;i<=n;i++){
            result *=i;
        }
        return result;
    }
}